package com.itboye.sunsun.share;

import com.itboye.sunsun.R;
import com.itboye.sunsun.support.BaseDialogFragment;
import com.tencent.mm.sdk.modelmsg.SendMessageToWX;
import com.tencent.mm.sdk.modelmsg.SendMessageToWX.Req;
import com.tencent.mm.sdk.modelmsg.WXMediaMessage;
import com.tencent.mm.sdk.modelmsg.WXTextObject;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;

public class ShareDialogFragment extends BaseDialogFragment {

	View weixin;
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		return inflater.inflate(R.layout.dialog_share, null);
	}
	
	
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		
		super.onActivityCreated(savedInstanceState);
		weixin.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				doWeiXin();
			}

			
		});
		
	}
	
	private void doWeiXin() {
		// TODO Auto-generated method stub
		WXTextObject textObject=new WXTextObject();
		textObject.text="test123";
		
		WXMediaMessage msg=new WXMediaMessage();
		msg.mediaObject=textObject;
		msg.description="test123";
		
		
		SendMessageToWX.Req req=new Req();
		req.transaction=System.currentTimeMillis()+"";
		req.message=msg;
		
		req.scene=SendMessageToWX.Req.WXSceneSession;
		
		
		
		
	}
}















































